/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2020-08-04 10:54:19
 * @LastEditors: kl2018
 * @LastEditTime: 2020-08-18 15:00:35
 */
import React, { PureComponent } from 'react';
// import BaseTableComp from "./common/BaseTableComp";
// import { WeaLocaleProvider } from "ecCom";
import { hashHistory } from 'react-router';

// const { getLabel } = WeaLocaleProvider

class OdocLibraryNewComponent extends PureComponent {
  constructor(props) {
    super(props);
    const { location } = props;
    const { officalType } = location.query;
    if (officalType && officalType == 1) {
      hashHistory.replace({
        pathname: '/main/offical/customPage',
        query: {
          customListId: -13,
          ...location.query,
        },
      });
      return;
    }
    if (officalType && officalType == 2) {
      hashHistory.replace({
        pathname: '/main/offical/customPage',
        query: {
          customListId: -17,
          ...location.query,
        },
      });
      return;
    }
    if (officalType && officalType == 3) {
      hashHistory.replace({
        pathname: '/main/offical/customPage',
        query: {
          customListId: -21,
          ...location.query,
        },
      });
      return;
    }
    hashHistory.replace({
      pathname: '/main/offical/customPage',
      query: {
        customListId: -8,
        ...location.query,
      },
    });
  }

  render() {
    return (<span />);
  }

  getColumns = (columns) => {
    let newColumns = columns.map(column =>
      column,
    );
    return newColumns;
  }
}

export default props => <OdocLibraryNewComponent ecId={`${this && this.props && this.props.ecId || ''}_OdocLibraryNewComponent@iglrrg`} {...props} key={props.location.query.officalType || '0'} />;
